/**
 * Created by DELL on 2016/6/23.
 */
function ani(obj){
    if($(obj).length >= 1){
//            $(obj).on('mouseover',function(){
//                $(this).stop()
//            });
        $(obj).each(function(){
            var ul_height = $(this).height();
            var box = $(this).parent().height();
            var speed = 0.03;
            if(ul_height>box){
                var h =  box - ul_height;
                var Time = (ul_height - box)/speed;
                $(this).animate({
                    marginTop:h+'px'
                },Time,'linear',function(){
                    $(this).css('margin-top','0');
                    ani(obj)
                })
            }
        })
    }
}
var a = new ani('.scroll');
